package com.example.myyunpan.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.myyunpan.entity.domain.FileInfo;
import com.example.myyunpan.entity.dto.SessionWebUserDto;
import com.example.myyunpan.entity.dto.UploadResultDto;
import com.example.myyunpan.entity.query.FileInfoQuery;
import com.example.myyunpan.entity.vo.FolderVO;
import com.example.myyunpan.entity.vo.PaginationResultVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
* @author 111
* @description 针对表【file_info(文件信息)】的数据库操作Service
* @createDate 2024-10-23 11:41:27
*/
public interface FileInfoService extends IService<FileInfo> {

    PaginationResultVO queryPageInfo(FileInfoQuery query);

    UploadResultDto uploadFile(SessionWebUserDto userInfo, String fileId, MultipartFile file, String fileName,
                               String filePid, String fileMd5, Integer chunkIndex, Integer chunks);

    void getFile(HttpServletResponse response, String fileId, String userId);

    FileInfo newFolder(String filePid, String userId, String fileName);

    List<FolderVO> getFolderInfo(String path, String userId);

    FileInfo rename(String userId, String fileId, String fileName);

    List<FileInfo> findListByParam(FileInfoQuery fileInfoQuery);

    void changeFileFolder(String userId, String fileIds, String filePid);

    String createDownloadUrl(String fileId, String userId);

    void download(HttpServletRequest request, HttpServletResponse response, String code);

    /*删除到回收站*/
    void removeFile4RecycleBatch(String userId, String fileIds);

    void recoverFileBatch(String userId, String fileIds);

    /*彻底删除*/
    void delFileBatch(String userId, String fileIds , Boolean adminOp);

    FileInfo getFileInfoByFileIdAndUserId(String fileId, String userId);

    void checkRootFilePid(String fileId, String shareUserId, String filePid);

    void saveShare(String fileId, String shareFileIds, String myFolderId, String shareUserId, String userId);
}
